#ifndef journaltabwidget_H
#define journaltabwidget_H

#include <KTabWidget>

/**
 * A KTabWidget that automatically hides the tab bar when only one tab is open.
 */
class JournalTabWidget : public KTabWidget
{
    Q_OBJECT

public:
    /**
     * Overrides the constructor to make some inital configuration and disable the tab bar.
     */
    JournalTabWidget(QWidget *parent=0);

    /**
     * Overrides the addTab method to check if more than one tab is visible and
     * activates the tab bar when needed.
     */
    void addTab(QWidget *page, const QString &label);

    /**
     * Overrides the addTab method to check if more than one tab is visible and
     * activates the tab bar when needed.
     */
    void addTab(QWidget *page, const QIcon &icon, const QString &label);
};

#endif
